package com.auto.autoapp.util

import kotlin.random.Random

object Util {
    fun needHandle(prop: Int?): Boolean {
        if (prop == null) return false
        val roll = Random.nextInt(0, 100)
        return roll < prop
    }

    fun matchKeyword(content: String?, includeKeyword: String?, excludeKeyword: String?): Boolean {
        if (content.isNullOrEmpty()) return false
        if (!excludeKeyword.isNullOrEmpty() && content.contains(excludeKeyword)) return false
        if (!includeKeyword.isNullOrEmpty() && content.contains(includeKeyword)) return true
        return true
    }
}